package com.zxk.gulimallcoupon;


import com.zxk.gulimall.coupon.GulimallCouponApplication;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.web.servlet.ModelAndView;

import java.net.URI;
import java.net.URISyntaxException;

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK,classes = GulimallCouponApplication.class)
@AutoConfigureMockMvc
public class GulimallCouponApplicationTest1 {

    @Autowired
    private MockMvc mvc;

    @Test
    public void test() throws Exception {
        String contentAsString = mvc.perform(MockMvcRequestBuilders.post(new URI("/coupon/coupon/list"))).andReturn().getResponse().getContentAsString();
        System.out.println(contentAsString);
    }

}
